import request from '@/utils/request'

export function addApplyForUp(data) { //服务立项--维修计划编号
    return request({
        url: '/maintenance-system/api/maintenance/repairInfo/lx/listnew',
        method: 'post',
        data
    })
}
export function addApplyForAdd(data) { //服务立项申请-添加
    return request({
        url: '/maintenance-system/api/procurement/service/add',
        method: 'POST',
        data
    })
}
export function addApplyForList(data) { //服务立项申请-列表
    return request({
        url: '/maintenance-system/api/procurement/page',
        method: 'post',
        data
    })
}
export function addApplyForAppList(data) { //服务立项申请-审批列表
    return request({
        url: '/maintenance-system/api/process/audit/approval/page',
        method: 'post',
        data
    })
}
export function addApplyForDetail(data) { //服务立项申请-单条查询
    return request({
        url: '/maintenance-system/api/procurement/id',
        method: 'post',
        data
    })
}
export function addApplyForEdit(data) { //服务立项申请-修改
    return request({
        url: '/maintenance-system/api/procurement/edit',
        method: 'post',
        data
    })
}
export function addApplyForDelete(data) { //服务立项申请-删除
    return request({
        url: '/maintenance-system/api/procurement/service/del',
        method: 'post',
        data
    })
}
export function addApplyForSaveSubmit(data) { //服务立项申请 保存并提交
    return request({
        url: '/maintenance-system/api/procurement/commit',
        method: 'post',
        data,
    })
}
export function addApplyForSaveSap(data) { //通过主键推送数据至SAP
    return request({
        url: '/maintenance-system/api/procurement/push/id',
        method: 'post',
        data,
    })
}
export function addApplyForSaveYuliu(data) { //预留单号
    return request({
        url: '/maintenance-system/api/procurement/reserve/id',
        method: 'post',
        data,
    })
}
export function addApplyForSaveWuliao(data) { //读取物料主数据
    return request({
        url: '/maintenance-system/api/procurement/material/id',
        method: 'post',
        data,
    })
}
export function addApplyForSaveGengxin(data) { //读取更新信息
    return request({
        url: '/maintenance-system/api/procurement/change/id',
        method: 'post',
        data,
    })
}
export function addApplyForMaterialAdd(data) { //物资立项申请-添加
    return request({
        url: '/maintenance-system/api/procurement/material/add',
        method: 'POST',
        data
    })
}
export function addApplyForMaterialEdit(data) { //物资立项申请-修改
    return request({
        url: '/maintenance-system/api/procurement/material/edit',
        method: 'POST',
        data
    })
}
export function addApplyForMaterialDetails(data) { //物资立项申请-详情
    return request({
        url: '/maintenance-system/api/procurement/material/detail',
        method: 'POST',
        data
    })
}
export function addApplyForSaveSubmitWuzi(data) { //物资立项申请 保存并提交
    return request({
        url: '/maintenance-system/api/procurement/material/commit',
        method: 'post',
        data,
    })
}
export function addApplyForWuziList(data) { //物资立项申请-列表
    return request({
        url: '/maintenance-system/api/procurement/material/page',
        method: 'post',
        data
    })
}
export function addApplyForAppWuziList(data) { //物资立项申请-审批列表
    return request({
        url: '/maintenance-system/api/process/audit/material/page',
        method: 'post',
        data
    })
}
export function addApplyForWuziDelete(data) { //物资立项申请-删除
    return request({
        url: '/maintenance-system/api/procurement/material/del',
        method: 'post',
        data
    })
}
export function addApplyForSaveWuziSap(data) { //物料通过主键推送数据至SAP
    return request({
        url: '/maintenance-system/api/procurement/material/push',
        method: 'post',
        data,
    })
}










export function addApplyForListAll(data) { //立项申请-列表
    return request({
        url: '/maintenance-system/api/maintenance/project/approval/wx/all',
        method: 'post',
        data
    })
}
export function deptList() { //查询二级分公司包含自己公司
    return request({
        url: '/sys-center/api/system/dept',
        method: 'get'
    })
}
export function addApplyForContractList(data) { //创建合同查合同编号
    return request({
        url: '/maintenance-system/api/contractManagementRecord/contractManagementRecord',
        method: 'post',
        data,
    })
}
export function addApplyForSave(data) { //合同编号 保存
    return request({
        url: '/maintenance-system/api/contractManagementRecord/edit',
        method: 'post',
        data,
    })
}
export function contractRelated(data) { //立项关联合同
    return request({
        url: '/maintenance-system/api/contractManagementRecord/contractInfo/link',
        method: 'post',
        data,
    })
}

export const addApplyForExport = (data) => { //导出
    return request.request({
      url: '/maintenance-system/api/maintenance/project/approval/detail/export',
      responseType: 'arraybuffer',
      method: 'post',
      data,
    })
  }
  export const addApplyForExportAll = (data) => { //导出全部
    return request.request({
      url: '/maintenance-system/api/maintenance/project/approval/export',
      responseType: 'arraybuffer',
      method: 'post',
      data,
    })
  }
